<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'ls.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<meta  http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
    <style>
    body{
    overflow-x: hidden;
    }
    .wt{
    width: 35%;
    height: 55%;
   /*  border:1px solid #000; */
    background-image: url("2.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    }
    .tx{
    display: block;
    width: 80%;
    height: 60%;
    border-radius:20px;
    border:0px solid #000;
    outline-style: none;
    padding-left: 15px;
    font-size: 1em;
    margin: 8% 10%;
    resize:none;
    background-color: transparent;
    }
	</style>
  <body>
   <div class="wt" ><!-- 舞台 -->
	<textarea class="tx" placeholder="请输入文字">
	
	
	</textarea>
	</div>
  </body>
<script src="jquery.js"></script>
  <script type="text/javascript">
 	var st=[];
  	var height=$(document.body).height();
  	var width=$(document.body).width();
  	var theight=$(".tx").height();
  	var twidth=$(".tx").width();
  	var max_height=(height/theight).toFixed(0);
  	console.log("最大的高度："+(height/theight).toFixed(0));
  	var num=(height*width)/(theight*twidth);
  	var sb=[];
  	console.log("height:"+height+"width:"+width);
  	console.log("theight"+theight+"twidth"+twidth);
  	console.log(sb);
  	for(var n=0;n<=num;n++){
  	sb[n]=n+1;
  	}
  	console.log(sb);
  	
	$(".tx").val("");
	
	var count=5;
	arr(sb,count);
	
  	function arr(sb,count){
		var temp=0;
		for (var i = 0; i < count; i++) {
			var num=parseInt(Math.random()*10);
			console.log("num:"+num);
			//temp=sb[num];
			//console.log("temp:"+temp);
			if(st.indexOf(num)=="-1"){
			st[temp]=num;
			temp++;
			}
		}
		console.log(st.toString());
		for(var m=0;m<st.length;m++){
		if(m>st.length/max_height)
		$("body").append("<div class='wt' style='margin-top:"+height+";margin-left:"+twidth*st[m]+"' >	<textarea class='tx' placeholder='请输入文字'>	</textarea>	</div>");
		}
  	}
  	
  </script>
</html>
